package Spring.demo.component;

import org.springframework.beans.factory.BeanNameAware;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

public class BeanLifeComponent  implements BeanNameAware {
    @PostConstruct
    public void postConstruct() {
        System.out.println("执⾏ PostConstruct()");
    }
    public void init() {
        System.out.println("执⾏ BeanLifeComponent init-method");
    }

    public void setBeanName(String s) {
        System.out.println("执⾏了通知 ");
    }
    @PreDestroy
    public void preDestroy() {
        System.out.println("执⾏：preDestroy()");
    }
}
